package com.lost.octopus.es.processor.config;

import com.sunsharing.share.boot.framework.web.standard.core.ExceptionHandlerRegister;
import com.sunsharing.share.boot.framework.web.standard.core.ExceptionHandlerRegistry;
import com.sunsharing.share.common.base.exception.ShareResponseCode;
import org.springframework.stereotype.Component;

/**
 * 注册异常,将内部异常也都全部打印出堆栈
 * @author zhangbh
 **/
@Component
public class CustomExceptionHandlerRegister implements ExceptionHandlerRegister {
    @Override
    public void registerExceptions(ExceptionHandlerRegistry registry) {
        registry.registerException(Exception.class,
            true,
            ShareResponseCode.INNER_SYSTEM_ERROR,
            ex -> ex);
    }
}
